package com.qifenqian.turbot.module.contract

import com.qifenqian.turbot.module.entity.response.LoginEntity
import com.qifenqian.turbot.module.entity.response.RegisterEntity
import com.qifenqian.turbot.module.entity.response.UploadEntity
import com.qifenqian.turbot.module.entity.response.VersionEntity
import com.qifenqian.turbot.net.ModelCallback

/**
 * @author H
 * @createTime 2018/12/28 17:47
 * @description
 * @see
 * @since
 */
interface AccountContract {

    interface Model {
        /**
         * 检测版本
         */
        fun checkVersion(callback: ModelCallback<VersionEntity>?)

        /**
         * 发送验证码
         */
        fun sendSmsCode(type: Int, callback: ModelCallback<Nothing>)

        /**
         * 登录
         */
        fun login(userCode: String, password: String = "", loginType: Int, smsCode: String = "", showDialog: Boolean, callback: ModelCallback<LoginEntity>)

        /**
         * 注册
         */
        fun register(userCode: String, smsCode: String, password: String, callback: ModelCallback<RegisterEntity>)

        /**
         * 资质认证第一步
         */
        fun identityVerifyFirst(userCode: String, frontPhotoOfIdCard: String, backPhotoOfIdCard: String, bankNo: String, bankName: String, phone: String, smsCode: String, callback: ModelCallback<Nothing>)

        /**
         * 资质认证第二步
         */
        fun identityVerifySecond(userCode: String, businessLicense: String, storePhotos: MutableList<String>, cateringServiceLicense: String, callback: ModelCallback<Nothing>)

        /**
         * 忘记密码
         */
        fun resetPassword(userCode: String, password: String, smsCode: String, callback: ModelCallback<*>)

        /**
         * 退出?
         */
        fun logout(userCode: String, callback: ModelCallback<Nothing>)

        /**
         * 修改手机号
         */
        fun modifyPhone(oldPhone: String, password: String, newPhone: String, smsCode: String, callback: ModelCallback<Nothing>)

        /**
         * 修改登录密码
         */
        fun modifyPassword(oldPassword: String, newPassword: String, callback: ModelCallback<Nothing>)

        /**
         * 反馈
         */
        fun giveFeedback(content: String, callback: ModelCallback<Nothing>)

        /**
         * 上传资料图片
         */
        fun uploadFile(filePath: String, callback: ModelCallback<UploadEntity>)

    }

    interface View {
        fun checkVersionResult(isSuccess: Boolean, code: Int = 0, msg: String? = null, versionEntity: VersionEntity? = null) {}

        fun sendSmsCodeResult(isSuccess: Boolean, code: Int = 0, msg: String? = null) {}

        fun loginResult(isSuccess: Boolean, code: Int = 0, msg: String? = null, loginEntity: LoginEntity? = null, versionEntity: VersionEntity? = null, password: String? = null) {}

        fun registerResult(isSuccess: Boolean, code: Int = 0, msg: String? = null) {}

        fun identityVerifyFirstResult(isSuccess: Boolean, code: Int = 0, msg: String? = null) {}

        fun identityVerifySecondResult(isSuccess: Boolean, code: Int = 0, msg: String? = null) {}

        fun resetPasswordResult(isSuccess: Boolean, code: Int = 0, msg: String? = null) {}

        fun logoutResult(isSuccess: Boolean, code: Int = 0, msg: String? = null) {}

        fun modifyPhoneResult(isSuccess: Boolean, code: Int = 0, msg: String? = null) {}

        fun modifyPasswordResult(isSuccess: Boolean, code: Int = 0, msg: String? = null) {}

        fun giveFeedbackResult(isSuccess: Boolean, code: Int = 0, msg: String? = null) {}

        fun uploadFileResult(isSuccess: Boolean, code: Int = 0, msg: String? = null, requestCode: Int = -1, uploadEntity: UploadEntity? = null) {}
    }

    interface Presenter {
        fun checkVersion()

        fun sendSmsCode(type: Int)

        fun login(userCode: String, password: String = "", loginType: Int, smsCode: String = "", showDialog: Boolean, versionEntity: VersionEntity? = null)

        fun register(userCode: String, smsCode: String, password: String)

        fun identityVerifyFirst(userCode: String, frontPhotoOfIdCard: String, backPhotoOfIdCard: String, bankNo: String, bankName: String, phone: String, smsCode: String)

        fun identityVerifySecond(userCode: String, businessLicense: String, storePhotos: MutableList<String>, cateringServiceLicense: String)

        fun resetPassword(userCode: String, password: String, smsCode: String)

        fun logout(userCode: String)

        fun modifyPhone(oldPhone: String, password: String, newPhone: String, smsCode: String)

        fun modifyPassword(oldPassword: String, newPassword: String)

        fun giveFeedback(content: String)

        fun uploadFile(requestCode: Int, filePath: String)
    }
}
